<style scoped>
	.mt20 {
		color: #fff;
	}
</style>
<template>
  <div>
    {{ id }}

    <el-row>
      <el-col :span="12">
        <el-form :model="obj" label-width="100px" class="mt20">
          <el-form-item label="网格名称：">
            {{ obj.company_name }}
          </el-form-item>

          <el-form-item label="辖区面积：" v-if="obj.type == '1'">
            {{ obj.all_space }}
          </el-form-item>
					<el-form-item label="辖区面积：" v-if="obj.type == '2'">
            {{ obj.city_space }}
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="12">
        <el-form :model="obj" label-width="100px" class="mt20">
          <el-form-item label="网格级别：">
            {{ obj.type }}
          </el-form-item>

          <el-form-item label="辖区人口：" v-if="obj.type == '1'">
            {{ obj.all_person }}
          </el-form-item>
					<el-form-item label="辖区人口：" v-if="obj.type == '2'">
            {{ obj.person_num }}
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  name: "info",

  data() {
    return {
      obj: {},
    };
  },

  props: {
    gridid: {
      type: String,
      default: "",
    },
  },

  components: {},

  computed: {
    ...mapGetters([]),

    id() {
      if (this.gridid == "") return "";
      this.$http({
        fun: "homeGridInfo",
        grid_id: this.gridid,
        cb: (res) => {
          this.obj = res;
        },
      });
      return "";
    },
  },

  methods: {
    init() {},
  },

  watch: {},
  mounted() {
    this.init();
  },
};
</script>

<style scoped>
</style>
